NDepend.API Documentation
ContainsSameCodeElementsThan<TCodeElement>(HashSet<TCodeElement>,IEnumerable<TCodeElement>) Method
NDepend.CodeModel Namespace > ExtensionMethodsHelpers Class > ContainsSameCodeElementsThan Method : ContainsSameCodeElementsThan<TCodeElement>(HashSet<TCodeElement>,IEnumerable<TCodeElement>) Method
The code element type that is ICodeElement or that implements ICodeElement.
This hahshet of code elements objects.
The other sequence of code elements objects.
Returns true if this codeElementsHashset hashset contains the same set of code elements than the otherCodeElements sequence. Otherwise returns false.
Syntax
[Extension()]
public static bool ContainsSameCodeElementsThan<TCodeElement>( 
   HashSet<TCodeElement> codeElementsHashset,
   IEnumerable<TCodeElement> otherCodeElements
)
where TCodeElement: class, ICodeElement

Parameters

codeElementsHashset
This hahshet of code elements objects.
otherCodeElements
The other sequence of code elements objects.

Type Parameters

TCodeElement
The code element type that is ICodeElement or that implements ICodeElement.
Remarks
This ContainsSameCodeElementsThan<TCodeElement>(IEnumerable<TCodeElement>,IEnumerable<TCodeElement>) overload, relies on the fact that both codeElementsHashset and otherCodeElements are hashsets, to execute with a faster O(otherCodeElements.Count) time complexity.
Notice that otherCodeElements can contain doublons, hence this operation first gets otherCodeElements.Distinct().
codeElementsHashset necessarily contains distinct code elements.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsHelpers Class
ExtensionMethodsHelpers Members
Overload List